﻿#region

using HouseHoldBudget.Core.Authentication;
using HouseHoldBudget.Core.Entities.User;
using HouseHoldBudget.Core.Infrastructure;
using HouseHoldBudget.Services.Users;

#endregion

namespace HouseHoldBudget.Framework.Authentication
{
    public static class BudgetAuthenticationHelper
    {
        #region Class Methods

        /// <summary>
        ///   Validates the user.
        /// </summary>
        /// <param name="username"> The username. </param>
        /// <returns> </returns>
        public static BudgetIdentity ValidateUser(string username)
        {
            IUserService s = EngineContext.Current.Resolve<IUserService>();
            BudgetUser User = s.ValidateWindowsUser(username);
            return new BudgetIdentity(User);
        }

        #endregion
    }
}